###########################################################################################
# README File #############################################################################
# Appellate Court Influence over District Courts in the United States #####################
# Michael P. Olson and Albert H. Rivero ###################################################
###########################################################################################

# Overview ################################################################################

	This file describes all of the data files and scripts used to produce the results 
	from "Appellate Court Influence over District Courts in the United States," 
	forthcoming at JPIPE. Additional files used to create analysis datasets are 
	available from the authors upon request.

	We have set up the package so that the only file the replicator must run to
	output all figures and tables in the paper and appendix is analysis.R.
	wild_bootstrap_analyses.do can be run first to output the bootstrap confidence
	intervals in circuit_wild_ci.csv, district_wild_ci.csv, and state_wild_ci.csv, and
	should be run first if the replicator wants to completely replicate our analyses
	(otherwise they'll be relying on our generated bootstrap confidence intervals).
	get_panel_means.R is included for the interested replicator who would like to see
	the procedure used to calculate the mean panel median measure, but is not necessary
	to conduct any analyses as we include panel_means.rds, its output, in the 
	replication package.	

# Software ################################################################################

	Analysis was done in R version 4.1.2 and Stata SE 17 on a Dell PC running Windows 10.

	In Stata, the "boottest" package was used; In R, we use the following packages:

	foreign 0.8-81
	tidyverse 1.3.1
	lfe 2.8-7.1
	stargazer 5.2.2
	ggplot2 3.3.5
	readxl 1.3.1
	viridis 0.6.2
	interflex 1.2.6
	fixest 0.10.1
	english 1.2-6
	stringr 1.4.0
	DataCombine 0.2.21

# Scripts #################################################################################

	wild_bootstrap_analyses.do

		this script runs regressions and produces wild-bootstrapped confidence 
		intervals that are then read into the main analysis file.

	analysis.R
	
		this script produces all figures and tables for both the main text and 
		online appendix. it primarily uses "district.csv" but also loads in 
		"panel_means.rds" and "jcs_circuit_month.csv."

	get_panel_means.R

		not necessary to replicate results; included in case replicators are 
		interested. uses "jcs_circuit_month.csv" to create the mean panel
		median measure used in the text. can be run prior to other scripts to 
		create mean panel medians, but we supply this data already made as well.

# Data ####################################################################################

	jcs_circuit_month.csv

		contains jcs ideal point estimates, indicating the court on which each 
		judge served and their year and month of arrival and departure.

	panel_means.rds

		contains the mean panel median for each circuit-month. 

	district.csv

		our main analysis dataset; merges district court decisions with the
		circuit-level mean panel median measure, as well as other covariates.

	district/state/circuit_wild_ci.xlsx
	
		three files containing ends of bootstrapped confidence intervals. 
		generated from our run of wild_bootstrap_analyses.do, and would 
		be overwritten by the replicator running said file.

 
